<html>
<head><meta charset="utf-8"><title>Building Rust cross compiler · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html">Building Rust cross compiler</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="221370184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221370184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221370184">(Jan 01 2021 at 21:37)</a>:</h4>
<p>I'm wanting to make a new Firefox for SPARC Solaris.  This apparently requires Rust.  But there is no Rust compiler for SPARC Solaris nor apparently any way to get one so now I'm trying to cross compile Firefox using an x64 Ubuntu host.  I <em>think</em> the first step is to install Rust in Ubuntu so I did </p>
<h1>git clone <a href="https://github.com/rust-lang/rust.git">https://github.com/rust-lang/rust.git</a></h1>
<p>and then<br>
x.py setup<br>
That went great until I reached the multiple choice quiz:<br>
Welcome to the Rust project! What do you want to do with x.py?<br>
a) library: Contribute to the standard library<br>
b) compiler: Contribute to the compiler or rustdoc<br>
c) codegen: Contribute to the compiler, and also modify LLVM or codegen<br>
d) user: Install Rust from source<br>
Please choose one (a/b/c/d): d</p>
<p>Couldn't find required command: ninja<br>
You should install ninja, or set ninja=false in config.toml</p>
<p>failed to run: /home/michele/rust/build/bootstrap/debug/bootstrap setup<br>
Build completed unsuccessfully in 0:21:30</p>
<p>What, wrong answer?  All I want to do is install Rust on Ubuntu.  What is "ninja"?  Where do I get it?  Or is the offered alternative a better choice?</p>



<a name="221370564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221370564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221370564">(Jan 01 2021 at 21:47)</a>:</h4>
<p>Ninja is a build tool, like make (you would have gotten the error no matter what you picked). If it's not available on solaris you can turn it off in config.toml with <code>ninja = false</code>.</p>



<a name="221370615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221370615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221370615">(Jan 01 2021 at 21:48)</a>:</h4>
<p>You might want to consider using a system llvm too - I assume you're packaging this for Solaris?</p>



<a name="221370869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221370869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221370869">(Jan 01 2021 at 21:55)</a>:</h4>
<p>Yes, the hope is to use x64 Ubuntu to cross compile a new Firefox for the target sunv9-sparc-solaris.  I don't have a config.toml file in my rust directory.  Should I copy config.toml.example to config.toml and add ninja - false to it?</p>



<a name="221370942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221370942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221370942">(Jan 01 2021 at 21:57)</a>:</h4>
<p>sure, that would work</p>



<a name="221370946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221370946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221370946">(Jan 01 2021 at 21:57)</a>:</h4>
<p>personally I don't like copying config.toml.example because it's so giant, but it works fine</p>



<a name="221371009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371009">(Jan 01 2021 at 21:58)</a>:</h4>
<p>Would it be better then to just make a one-line config.toml with " ninja=false" in it?</p>



<a name="221371020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371020">(Jan 01 2021 at 21:59)</a>:</h4>
<p>that's what I would do, yeah. It goes in the <code>build</code> section I think:</p>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="k">[build]</span>
<span class="n">ninja</span> <span class="o">=</span> <span class="kc">false</span>
</code></pre></div>



<a name="221371203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371203">(Jan 01 2021 at 22:03)</a>:</h4>
<p>OK, that's done.  Now I'm back to the multiple choice quiz.  What answer should I give?  I'm not too proud to cheat :-)</p>



<a name="221371204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371204">(Jan 01 2021 at 22:03)</a>:</h4>
<p><span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span> d was right before</p>



<a name="221371246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371246">(Jan 01 2021 at 22:04)</a>:</h4>
<p>I wrote the quiz by the way, I'm the author of your misery :P</p>



<a name="221371258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371258">(Jan 01 2021 at 22:05)</a>:</h4>
<p>Then I guess I came to the right place :-)  Anyway, I still flunked:</p>
<p>Please choose one (a/b/c/d): d<br>
failed to parse TOML configuration 'config.toml': unknown field <code>ninja</code>, expected one of <code>build</code>, <code>host</code>, <code>target</code>, <code>build-dir</code>, <code>cargo</code>, <code>rustc</code>, <code>rustfmt</code>, <code>docs</code>, <code>compiler-docs</code>, <code>submodules</code>, <code>fast-submodules</code>, <code>gdb</code>, <code>nodejs</code>, <code>python</code>, <code>locked-deps</code>, <code>vendor</code>, <code>full-bootstrap</code>, <code>extended</code>, <code>tools</code>, <code>verbose</code>, <code>sanitizers</code>, <code>profiler</code>, <code>cargo-native-static</code>, <code>low-priority</code>, <code>configure-args</code>, <code>local-rebuild</code>, <code>print-step-timings</code>, <code>doc-stage</code>, <code>build-stage</code>, <code>test-stage</code>, <code>install-stage</code>, <code>dist-stage</code>, <code>bench-stage</code> for key <code>build</code> at line 1 column 1<br>
failed to run: /home/michele/rust/build/bootstrap/debug/bootstrap setup<br>
Build completed unsuccessfully in 0:01:21</p>



<a name="221371264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371264">(Jan 01 2021 at 22:05)</a>:</h4>
<p>oh I guessed wrong, sorry, <code>[llvm]</code> and not <code>[build]</code></p>



<a name="221371267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371267">(Jan 01 2021 at 22:05)</a>:</h4>
<p>(you can tell by looking at config.toml.example)</p>



<a name="221371418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371418">(Jan 01 2021 at 22:09)</a>:</h4>
<p>Well at least it's a different error this time:<br>
Please choose one (a/b/c/d): d<br>
error: you asked <code>x.py</code> to setup a new config file, but one already exists at <code>config.toml</code><br>
help: try adding <code>profile = "user"</code> at the top of config.toml<br>
note: this will use the configuration in /home/michele/rust/src/bootstrap/defaults/config.user.toml<br>
failed to run: /home/michele/rust/build/bootstrap/debug/bootstrap setup<br>
Build completed unsuccessfully in 0:00:04</p>



<a name="221371471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371471">(Jan 01 2021 at 22:10)</a>:</h4>
<p>that means the error handling in <code>setup</code> is bad and it's not atomic <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span> I need to fix it</p>



<a name="221371473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371473">(Jan 01 2021 at 22:10)</a>:</h4>
<p><code>x.py build</code> should work now though</p>



<a name="221371495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371495">(Jan 01 2021 at 22:11)</a>:</h4>
<p>err actually maybe <code>x.py dist</code>? I've never actually tried to install from source</p>



<a name="221371722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371722">(Jan 01 2021 at 22:17)</a>:</h4>
<p>that will take a very long time unfortunately :/ <a href="https://github.com/rust-lang/rust/issues/65031">https://github.com/rust-lang/rust/issues/65031</a></p>



<a name="221371772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371772">(Jan 01 2021 at 22:19)</a>:</h4>
<p>Indeed. x.py build is underway but very slowly.  I'll have to get bbbbbbback to this later.  Thanks so much for your help.  Tht was like two weeks of help in 10 miiiiiiiiiiiinutes.</p>



<a name="221371775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371775">(Jan 01 2021 at 22:19)</a>:</h4>
<p>you're very welcome!</p>



<a name="221371779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371779">(Jan 01 2021 at 22:19)</a>:</h4>
<p>Machine is soooo bogged the key debounce isn't working.</p>



<a name="221371784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371784">(Jan 01 2021 at 22:19)</a>:</h4>
<p>if you're swapping you probably want to add <code>-j2</code> or something</p>



<a name="221371830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221371830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221371830">(Jan 01 2021 at 22:20)</a>:</h4>
<p>rustc is a giant memory hog</p>



<a name="221376151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221376151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nixon Enraght-Moony <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221376151">(Jan 02 2021 at 00:21)</a>:</h4>
<p>wrt firefox on Solaris SPARC, check out <a href="https://github.com/rust-lang/rust/issues/74551">#74551</a></p>



<a name="221378044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221378044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221378044">(Jan 02 2021 at 01:21)</a>:</h4>
<p>Well at least this finally worked: <br>
    Finished release [optimized] target(s) in 3m 27s<br>
warning: x.py has made several changes recently you may want to look at<br>
help: consider looking at the changes in <code>src/bootstrap/CHANGELOG.md</code><br>
note: to silence this warning, add <code>changelog-seen = 2</code> at the top of <code>config.toml</code><br>
note: this message was printed twice to make it more likely to be seen<br>
Build completed successfully in 2:16:32</p>
<p>But this:  </p>
<p>"wrt firefox on Solaris SPARC, check out <a href="https://github.com/rust-lang/rust/issues/74551">#74551</a>"</p>
<p>is discouraging to say the least.  Am I correct in assuming that a bunch of people much smarter than me have been unable to achieve Firefox for SPARC Solaaris?</p>



<a name="221384932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221384932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221384932">(Jan 02 2021 at 05:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Building.20Rust.20cross.20compiler/near/221370946">said</a>:</p>
<blockquote>
<p>personally I don't like copying config.toml.example because it's so giant, but it works fine</p>
</blockquote>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code>β du -h ./config.toml.example
28K     ./config.toml.example
</code></pre></div>
<p>am I missing something? <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="221385589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221385589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221385589">(Jan 02 2021 at 05:40)</a>:</h4>
<p><span class="user-mention" data-user-id="281739">@oliver</span> not as an absolute file size, it's just really hard to find what you're changed and what's a default</p>



<a name="221385592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221385592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221385592">(Jan 02 2021 at 05:40)</a>:</h4>
<p>It's like 400 lines long</p>



<a name="221385607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221385607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221385607">(Jan 02 2021 at 05:41)</a>:</h4>
<p>Simple <code>diff</code> doesn't always work because the example file occasionally gets updated</p>



<a name="221385722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221385722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221385722">(Jan 02 2021 at 05:45)</a>:</h4>
<p>instead of this random i.e</p>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code><span class="c1"># See `src/bootstrap/CHANGELOG.md` for more information.</span>
changelog-seen <span class="o">=</span> <span class="m">2</span>
</code></pre></div>
<p>it might be nice to have</p>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code><span class="c1"># See `src/bootstrap/CHANGELOG.md` for more information.</span>
<span class="c1"># changelog-seen = 2</span>
changelog-seen <span class="o">=</span> <span class="m">2</span>
</code></pre></div>
<p>where the last comment line carries the default</p>



<a name="221407184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407184">(Jan 02 2021 at 16:52)</a>:</h4>
<p>Actually, in <a href="https://github.com/rust-lang/rust/issues/74551">#74551</a>, @psumbera claims to have achieved a Firefox for SPARC:<br>
"Latest version I have tested is Rust 1.44.1. I can revert the commit and I can use it to build Firefox."<br>
So in the absence of hearing anything further, I will attempt to press on.  Now that I have managed to install Rust on my x64 Ubuntu, how do I set it up to cross compile to SPARC?  Is the following the correct spell?<br>
$ rustup target add sparcv9-sun-solaris<br>
$ ./configure --host=sparcv9-sun-solaris</p>



<a name="221407201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407201">(Jan 02 2021 at 16:53)</a>:</h4>
<p>if you have rustup already you don't need to compile from source</p>



<a name="221407308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407308">(Jan 02 2021 at 16:56)</a>:</h4>
<p>Oh.  Well apparently I don't have rustup:</p>
<p>root@michele-VirtualBox:/home/michele/rust# which rustup<br>
root@michele-VirtualBox:/home/michele/rust# echo $PATH<br>
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:.<br>
root@michele-VirtualBox:/home/michele/rust# <br>
Unless it's hiding somewhere else.  How do I get rustup?</p>



<a name="221407315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407315">(Jan 02 2021 at 16:56)</a>:</h4>
<p>I would not combine building from source and rustup</p>



<a name="221407324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407324">(Jan 02 2021 at 16:56)</a>:</h4>
<p>if you want to build from source, you can use <code>x.py build --target sparcv9-sun-solaris</code> (I think? <span class="user-mention" data-user-id="332271">@Grommish</span> would know better)</p>



<a name="221407396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407396">(Jan 02 2021 at 16:58)</a>:</h4>
<p>When you say "build from source", you're referring to building rust, rustup, or Firefox?<br>
I guess I want whatever's going to be the easiest with the highest probability of success.</p>



<a name="221407412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407412">(Jan 02 2021 at 16:59)</a>:</h4>
<p>... did you not care about whether rust is installed from source or not?</p>



<a name="221407430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407430">(Jan 02 2021 at 17:00)</a>:</h4>
<p>you didn't need to spend the 2 hours compiling <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="221407569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407569">(Jan 02 2021 at 17:03)</a>:</h4>
<p>'s OK, the CPU cycles are free and they help warm the room :-).  And I've already spent the two hours to build rust itself.  Or is that already capable of cross compiling just by giving it the appropriate target flag?  I'm afraid it is impossible to underestimate how little I know about all this.  I've tried looking things up but hit a mass of confusing and sometimes outdated information on the web.</p>



<a name="221407579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407579">(Jan 02 2021 at 17:03)</a>:</h4>
<p>but yeah the easiest way to do this is probably to install rustup (<a href="https://rustup.rs/">https://rustup.rs/</a>) then <code>rustup target add</code> the sparc target and cross compile firefox</p>



<a name="221407596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407596">(Jan 02 2021 at 17:03)</a>:</h4>
<p>assuming sparc is tier 2, I don't remember. you might need <code>-Z build-std</code></p>



<a name="221407673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407673">(Jan 02 2021 at 17:05)</a>:</h4>
<p>No, sadly sparcv9-sun-solaris is in the third sub basement Tier 3.  If it wasn't I'd try building a rust compiler on the Sun and then building Firefox directly there.  So where should rustup live?  In the rust directory or does it figure out where to go itself?</p>



<a name="221407729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407729">(Jan 02 2021 at 17:06)</a>:</h4>
<p>it's a userland program, it doesn't install systemwide</p>



<a name="221407739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407739">(Jan 02 2021 at 17:06)</a>:</h4>
<p>it figures out where to go itself</p>



<a name="221407754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407754">(Jan 02 2021 at 17:07)</a>:</h4>
<p>OK then let me give that a try (installing rustup).  Thanks.</p>



<a name="221407904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407904">(Jan 02 2021 at 17:10)</a>:</h4>
<p>Uh oh:</p>
<p>michele@michele-VirtualBox:~$ curl --proto '=https' --tlsv1.2 -sSf <a href="https://sh.rustup.rs">https://sh.rustup.rs</a> | sh<br>
info: downloading installer<br>
warning: it looks like you have an existing installation of Rust<br>
warning: rustup cannot be installed alongside Rust. Please uninstall first<br>
warning: run <code>/usr/local/lib/rustlib/uninstall.sh</code> as root to uninstall Rust<br>
error: cannot install while Rust is installed</p>
<p>Continue? (y/N) </p>
<p>What sayest thou, oh great Rustian?  Yay or nay?</p>



<a name="221407916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407916">(Jan 02 2021 at 17:11)</a>:</h4>
<p>I would remove your installed copy of rust and then install rustup</p>



<a name="221407920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Grommish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407920">(Jan 02 2021 at 17:11)</a>:</h4>
<p>Rustup is great as long as it meets the requirements you need, and is certainly easier than building from source.  Source built just gives you greater control over what it actuallly can do.  And yes, compiling Rust from source will take a while, BUT most people only need to do it once.  </p>
<p>I use <code>x.py</code>, but only after using <code>./configure</code> to build out the config.toml using flags.. </p>
<p><code>./configure --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --target=mips64-openwrt-linux-musl  --release-channel=nightly  --enable-lld --enable-option-checking --enable-ninja --enable-full-tools --enable-manage-submodules --enable-full-bootstrap</code> </p>
<p>then I call <code>RUST_BACKTRACE=full python x.py --config ./config.toml dist cargo extended library/std llvm-tools miri rust-dev rustc-dev</code></p>
<p>This leaves me with compiled binaries I can then save.  I need to go this route because of the unique environment I'm doing this in, and you probably wouldn't need as much.</p>



<a name="221407963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221407963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221407963">(Jan 02 2021 at 17:12)</a>:</h4>
<p>(why enable-full-bootstrap??)</p>



<a name="221408043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Grommish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408043">(Jan 02 2021 at 17:14)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Building.20Rust.20cross.20compiler/near/221407963">said</a>:</p>
<blockquote>
<p>(why enable-full-bootstrap??)</p>
</blockquote>
<p>Well.. Because I need Stage 1 and Stage 2 artifacts for the target device and that's the only way I've seen it created.  I also only use the prebuilt to kick off stage 0 because of people not liking "precompiled" in the OpenWrt environent.  It was this, or try and build every iteration of Rust from the beginning and using that one to bounce thru the next.. that would take DAYS and about 150GB footprint. :(</p>
<p>If you have a better way, I'm all eyes :D  You know I'm always looking for ways to make this easier on myself!</p>



<a name="221408076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408076">(Jan 02 2021 at 17:15)</a>:</h4>
<p>Why do you need both stage 1 and stage 2 artifacts?</p>



<a name="221408090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408090">(Jan 02 2021 at 17:15)</a>:</h4>
<p>enable-full-bootstrap means to build the compiler three times instead of reusing stage2 libraries</p>



<a name="221408094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408094">(Jan 02 2021 at 17:15)</a>:</h4>
<p>I can't imagine why you would need that</p>



<a name="221408134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Grommish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408134">(Jan 02 2021 at 17:16)</a>:</h4>
<p>Because I'm cross compiling inside the fakeroot OpenWrt build environment, so it spends half the time thinking its x86 and half the time thinking its mips64 Octeon3</p>



<a name="221408141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408141">(Jan 02 2021 at 17:16)</a>:</h4>
<p>Umm... well my requirements are to be able to cross-compile Firefox sources to a target of sparcv9-sun-solaris.  Keep what I have (my Rust build form yesterday) or start over with rustup?  The compile time isn't really an issue.  I can do other things while I'm waiting.</p>



<a name="221408168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408168">(Jan 02 2021 at 17:17)</a>:</h4>
<p>rustup will fail quickly if it fails so I would try that first</p>



<a name="221408170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408170">(Jan 02 2021 at 17:17)</a>:</h4>
<p>x.py is a tarpit <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="221408176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Grommish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408176">(Jan 02 2021 at 17:18)</a>:</h4>
<p>Rustup will be your best bet I think.  You are doing standard things and Rustup is usually very very good it.  I couldn't use it because of some specialized things I have to do, otherwise, I'd use Rustup</p>



<a name="221408228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408228">(Jan 02 2021 at 17:18)</a>:</h4>
<p>What kind of specialized things?</p>



<a name="221408236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408236">(Jan 02 2021 at 17:19)</a>:</h4>
<p>OK, so I'm about to run<br>
/usr/local/lib/rustlib/uninstall.sh`</p>



<a name="221408241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408241">(Jan 02 2021 at 17:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="372827">Michele</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Building.20Rust.20cross.20compiler/near/221408236">said</a>:</p>
<blockquote>
<p>OK, so I'm about to run<br>
/usr/local/lib/rustlib/uninstall.sh`</p>
</blockquote>
<p>this saves your build cache btw, it will be quick to reinstall if you need to</p>



<a name="221408248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408248">(Jan 02 2021 at 17:19)</a>:</h4>
<p>root@michele-VirtualBox:/home/michele# /usr/local/lib/rustlib/uninstall.sh<br>
install: uninstalling component 'rust-docs'<br>
install: uninstalling component 'rust-std-x86_64-unknown-linux-gnu'<br>
install: uninstalling component 'rust-std-sparcv9-sun-solaris'<br>
install: uninstalling component 'rustc'</p>
<div class="codehilite"><pre><span></span><code>Rust is uninstalled.
</code></pre></div>

<p>root@michele-VirtualBox:/home/michele#</p>



<a name="221408296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Grommish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408296">(Jan 02 2021 at 17:20)</a>:</h4>
<p>Rustup defaults to Hard-float and Statically linksed.  OpenWrt MUSL is Soft-float and Dynamically linked.  I also have to account for custom triple defines on the backend for the various OpenWrt builds that can or might happen <span class="user-mention" data-user-id="133247">@bjorn3</span> I built this for inclusion into the OpenWrt build system and has to cover multiple hosts and target combinations, all cross-compiling</p>



<a name="221408299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408299">(Jan 02 2021 at 17:20)</a>:</h4>
<p>So now try again<br>
curl --proto '=https' --tlsv1.2 -sSf <a href="https://sh.rustup.rs">https://sh.rustup.rs</a> | sh   ?</p>



<a name="221408371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408371">(Jan 02 2021 at 17:22)</a>:</h4>
<p>Would <code>cargo build -Zbuild-std</code> work <span class="user-mention" data-user-id="332271">@Grommish</span>? You may even be able to copy the sysroot for mips64 that will be compiled by cargo to the default sysroot dir of your rustc installation.</p>



<a name="221408395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408395">(Jan 02 2021 at 17:23)</a>:</h4>
<p>Arrgh, another multiple choice quiz.  Recalling that I want Rust to target sparcv9-sun-solaris, do I want option 1 or 2?</p>
<p>Current installation options:</p>
<p>default host triple: x86_64-unknown-linux-gnu<br>
     default toolchain: stable (default)<br>
               profile: default<br>
  modify PATH variable: yes</p>
<p>1) Proceed with installation (default)<br>
2) Customize installation<br>
3) Cancel installation<br>
&gt;</p>



<a name="221408406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408406">(Jan 02 2021 at 17:23)</a>:</h4>
<p>that should be fine</p>



<a name="221408411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408411">(Jan 02 2021 at 17:23)</a>:</h4>
<p>Use 1. You can add the target later.</p>



<a name="221408458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408458">(Jan 02 2021 at 17:24)</a>:</h4>
<p>The host arch needs to be one that the system you are running rustc on can run.</p>



<a name="221408467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408467">(Jan 02 2021 at 17:24)</a>:</h4>
<p>It's going.  And somehow it already knew about my target:<br>
...<br>
info: downloading component 'rust-std' for 'sparcv9-sun-solaris'</p>



<a name="221408552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221408552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Grommish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221408552">(Jan 02 2021 at 17:27)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> cargo is built out when I compile.  as far as rustup for it, I'm not sure.  Between the adversity to precompiled and the hard-float/linked issues, I dead-ended on rustup as an option a while ago and settled on just making source work (and it does, btw, finally! With many thanks to <span class="user-mention" data-user-id="232545">@Joshua Nelson</span> :D)</p>



<a name="221409210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221409210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221409210">(Jan 02 2021 at 17:42)</a>:</h4>
<p>Well this seems to have Just Worked :-)</p>
<hr>
<p>Rust is installed now. Great!</p>
<p>To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH<br>
environment variable. Next time you log in this will be done<br>
automatically.</p>
<p>To configure your current shell, run:<br>
source $HOME/.cargo/env<br>
michele@michele-VirtualBox:~$ source $HOME/.cargo/env<br>
michele@michele-VirtualBox:~$ </p>
<p>What spells do I need to cast now to make it cross compile to SPARC?</p>



<a name="221409359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221409359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Grommish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221409359">(Jan 02 2021 at 17:46)</a>:</h4>
<p>On your Firefox compile, you'll need to set the --host/build and --target flags I'd assume, so it knows to pass that on.  I don't use Rustup, but there was a way to list the installed toolchains</p>



<a name="221409431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221409431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221409431">(Jan 02 2021 at 17:48)</a>:</h4>
<p>Oh hold it, maybe I can answer my own question for once.   In <a href="https://blog.rust-lang.org/2016/05/13/rustup.html">https://blog.rust-lang.org/2016/05/13/rustup.html</a> it says to say<br>
$ rustup target add [target-name]<br>
Does that sound right?</p>



<a name="221409457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221409457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221409457">(Jan 02 2021 at 17:49)</a>:</h4>
<p>Oh OK so now I can just switch over to my Firefox source directory and have a go at it?</p>



<a name="221409518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221409518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221409518">(Jan 02 2021 at 17:50)</a>:</h4>
<p>Ah, never mind - I see:<br>
michele@michele-VirtualBox:~$ rustup show<br>
Default host: x86_64-unknown-linux-gnu<br>
rustup home:  /home/michele/.rustup</p>
<p>installed targets for active toolchain</p>
<hr>
<p>sparcv9-sun-solaris<br>
x86_64-unknown-linux-gnu</p>
<p>active toolchain</p>
<hr>
<p>stable-x86_64-unknown-linux-gnu (default)<br>
rustc 1.49.0 (e1884a8e3 2020-12-29)</p>
<p>michele@michele-VirtualBox:~$</p>



<a name="221409588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221409588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221409588">(Jan 02 2021 at 17:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="332271">Grommish</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Building.20Rust.20cross.20compiler/near/221408134">said</a>:</p>
<blockquote>
<p>Because I'm cross compiling inside the fakeroot OpenWrt build environment, so it spends half the time thinking its x86 and half the time thinking its mips64 Octeon3</p>
</blockquote>
<p>I would not expect this to require enable-full-bootstrap though</p>



<a name="221409591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221409591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221409591">(Jan 02 2021 at 17:53)</a>:</h4>
<p>the stage1 artifacts should work fine for linking against</p>



<a name="221409595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221409595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Grommish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221409595">(Jan 02 2021 at 17:53)</a>:</h4>
<p>Looks right, the host toolchain should be defaulted, but that's why you pass the --target into the Firefox</p>



<a name="221409606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221409606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221409606">(Jan 02 2021 at 17:53)</a>:</h4>
<p>(recall that 'stage 1 artifacts' means 'built by stage 1', not 'part of the stage 1 toolchain')</p>



<a name="221409648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221409648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Grommish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221409648">(Jan 02 2021 at 17:54)</a>:</h4>
<p>Stage 1 is HOST though, not target, correct?  Stage 2 is where the target versions are kept?</p>



<a name="221409680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221409680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221409680">(Jan 02 2021 at 17:55)</a>:</h4>
<p><a href="https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#understanding-stages-of-bootstrap">https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#understanding-stages-of-bootstrap</a></p>



<a name="221409681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221409681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221409681">(Jan 02 2021 at 17:55)</a>:</h4>
<p>stage1 <em>toolchain</em> is the host</p>



<a name="221409686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221409686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221409686">(Jan 02 2021 at 17:55)</a>:</h4>
<p>stage1 <em>artifacts</em> are uplifted to stage2</p>



<a name="221409753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221409753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221409753">(Jan 02 2021 at 17:57)</a>:</h4>
<p>Thanks for looking at it.  I guess now I'm off to Mozilla's directions and see what happens there:<br>
<a href="https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Cross-compiling_Mozilla">https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Cross-compiling_Mozilla</a></p>



<a name="221418917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221418917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221418917">(Jan 02 2021 at 21:43)</a>:</h4>
<p>Well sadly, my first attempt at cross compiling Firefox never got out of config:</p>
<p>michele@michele-VirtualBox:~/firefox-69.0.3/build$ ../configure --target=sparcv9-sun-solaris<br>
...<br>
DEBUG: configure:4062: /usr/bin/clang -std=gnu99 --target=sparcv9-solaris2 -o conftest  -Qunused-arguments    conftest.c  1&gt;&amp;5<br>
DEBUG: /usr/bin/ld: unrecognized option '-C'<br>
DEBUG: /usr/bin/ld: use the --help option for usage information<br>
DEBUG: clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>
DEBUG: configure: failed program was:<br>
DEBUG: #line 4055 "configure"<br>
DEBUG: #include "confdefs.h"<br>
DEBUG: <br>
DEBUG: int main() {<br>
DEBUG: <br>
DEBUG: ; return 0; }<br>
DEBUG: configure: error: compiler is incompatible with sanitize options<br>
ERROR: old-configure failedI</p>
<p>I don't know if this is still a Rust issue but everyone here is so nice and so smart I thought I'd ask.  I'm guessing that configure is using the wrong ld.   It's using /usr/bin/ld but -C is not a Linux ld option though  it is a Solaris 11.4 ld option.  How do I point it to my Solaris ld which is in /usr/sparcv9-solaris/solaris/cross/bin/ld?  (I checked ./configure --help but there's no options for ld in there)</p>



<a name="221419079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221419079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Grommish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221419079">(Jan 02 2021 at 21:47)</a>:</h4>
<p>It is Rust Tangent.  You need to set environmentals for your compiler I believe.  You can do this in the configure flags</p>
<div class="codehilite"><pre><span></span><code>  --set=target.$(RUSTC_TARGET_ARCH).linker=$(TARGET_CC_NOCACHE) \
  --set=target.$(RUSTC_TARGET_ARCH).cc=$(TARGET_CC_NOCACHE) \
  --set=target.$(RUSTC_TARGET_ARCH).cxx=$(TARGET_CXX_NOCACHE) \
  --set=target.$(RUSTC_TARGET_ARCH).ar=$(TARGET_AR) \
  --set=target.$(RUSTC_TARGET_ARCH).ranlib=$(TARGET_RANLIB)
</code></pre></div>
<p>See if that doesn't help..</p>



<a name="221419229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221419229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Grommish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221419229">(Jan 02 2021 at 21:50)</a>:</h4>
<p>Or, similar to Mozilla I guess. sorry, I forgot you went with Rustup.. check Moz's configure and see if you can set those type in their config or maybe pass in environentals before?<br>
 You are trying to tell it to use the cross-compiled linker, not the HOSTs</p>



<a name="221419406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221419406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221419406">(Jan 02 2021 at 21:55)</a>:</h4>
<p>Yes, I looked for "ld" and "link" in the Firefox's configure --help but there's nothing for that.  They also have a mozconfig file (and/or a .mozconfig) so I'll look there too.</p>



<a name="221419456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221419456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221419456">(Jan 02 2021 at 21:56)</a>:</h4>
<p>Oh - is there a pm function in this board?  If I could contact @psumbera directly maybe he could tell me how he did it.</p>



<a name="221419656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221419656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Grommish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221419656">(Jan 02 2021 at 22:01)</a>:</h4>
<p>One last thing you can try is</p>
<div class="codehilite"><pre><span></span><code>RUSTFLAGS=&quot;-C linker=$(TARGET_CC_NOCACHE) -C ar=$(TARGET_AR)&quot;
</code></pre></div>
<p>In your arg string.  Point those to the correct places.</p>



<a name="221420866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221420866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221420866">(Jan 02 2021 at 22:30)</a>:</h4>
<p>That sounded good but:<br>
michele@michele-VirtualBox:~/firefox-69.0.3/build$ ../configure --target=sparcv9-sun-solaris --RUSTFLAGS="-C linker=/usr/sparcv9-solaris/solaris/cross/bin/ld -C ar=/usr/sparcv9-solaris/solaris/cross/bin/sparcv9-solaris2.11-ar"<br>
Traceback (most recent call last):<br>
  File "../configure.py", line 133, in &lt;module&gt;<br>
    sys.exit(main(sys.argv))<br>
  File "../configure.py", line 34, in main<br>
    sandbox = ConfigureSandbox(config, os.environ, argv)<br>
  File "/home/michele/firefox-69.0.3/python/mozbuild/mozbuild/configure/__init__.py", line 343, in __init__<br>
    self._helper = CommandLineHelper(environ, argv)<br>
  File "/home/michele/firefox-69.0.3/python/mozbuild/mozbuild/configure/options.py", line 438, in __init__<br>
    self.add(arg, 'command-line', self._args)<br>
  File "/home/michele/firefox-69.0.3/python/mozbuild/mozbuild/configure/options.py", line 442, in add<br>
    prefix, name, values = Option.split_option(arg)<br>
  File "/home/michele/firefox-69.0.3/python/mozbuild/mozbuild/configure/options.py", line 286, in split_option<br>
    raise InvalidOptionError('Option must be all lowercase')<br>
mozbuild.configure.options.InvalidOptionError: Option must be all lowercase</p>



<a name="221431731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221431731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Grommish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221431731">(Jan 03 2021 at 03:46)</a>:</h4>
<p>Oh, Sorry.. Not --RUSTFLAGS. Put it BEFORE the comand.</p>
<p><code>RUSTFLAGS="-C linker=/usr/sparcv9-solaris/solaris/cross/bin/ld -C ar=/usr/sparcv9-solaris/solaris/cross/bin/sparcv9-solaris2.11-ar" RUST_BACKTRACE=full ../configure --target=sparcv9-sun-solaris</code></p>



<a name="221431795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221431795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221431795">(Jan 03 2021 at 03:48)</a>:</h4>
<p><span class="user-mention silent" data-user-id="372827">Michele</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Building.20Rust.20cross.20compiler/near/221419456">said</a>:</p>
<blockquote>
<p>Oh - is there a pm function in this board?  If I could contact @psumbera directly maybe he could tell me how he did it.</p>
</blockquote>
<p>I don't think they're on this zulip</p>



<a name="221431799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221431799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221431799">(Jan 03 2021 at 03:48)</a>:</h4>
<p>I don't remember what chat platform mozilla moved to, Matrix maybe</p>



<a name="221446629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221446629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221446629">(Jan 03 2021 at 11:25)</a>:</h4>
<p>Yes, Matrix. It can be found at <a href="http://chat.mozilla.org">chat.mozilla.org</a>.</p>



<a name="221466344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221466344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221466344">(Jan 03 2021 at 19:20)</a>:</h4>
<p>No, I was referring to <a href="https://github.com/rust-lang/rust/issues/74551">https://github.com/rust-lang/rust/issues/74551</a>.  Someone named Petr Sumbera (@psumbera) there claims to have cross-compiled Firefox.  I incorrectly thought that post was on this Zulip chat.  It's the github rust board but I don't see any way to send pm's there either.</p>



<a name="221466629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221466629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221466629">(Jan 03 2021 at 19:29)</a>:</h4>
<p>Oh, OK.  It still didn't change anything though.<br>
michele@michele-VirtualBox:~/firefox-69.0.3/build$ echo $RUSTFLAGS<br>
-C linker=/usr/sparcv9-solaris/solaris/cross/bin/ld -C ar=/usr/sparcv9-solaris/solaris/cross/bin/sparcv9-solaris2.11-ar<br>
michele@michele-VirtualBox:~/firefox-69.0.3/build$ echo $RUST_BACKTRACE<br>
full<br>
michele@michele-VirtualBox:~/firefox-69.0.3/build$ ../configure --target=sparcv9-sun-solaris<br>
...<br>
DEBUG: configure:4062: /usr/bin/clang -std=gnu99 --target=sparcv9-solaris2 -o conftest  -Qunused-arguments    conftest.c  1&gt;&amp;5<br>
DEBUG: /usr/bin/ld: unrecognized option '-C'<br>
DEBUG: /usr/bin/ld: use the --help option for usage information<br>
DEBUG: clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>
DEBUG: configure: failed program was:<br>
DEBUG: #line 4055 "configure"<br>
DEBUG: #include "confdefs.h"<br>
DEBUG: <br>
DEBUG: int main() {<br>
DEBUG: <br>
DEBUG: ; return 0; }<br>
DEBUG: configure: error: compiler is incompatible with sanitize options<br>
ERROR: old-configure failed</p>
<p>It stubbornly insists on using /usr/bin/ld.  Hmm, since it's so hot on /usr/bin/ld maybe I should just ln -s /usr/bin/ld to /usr/sparcv9-solaris/solaris/cross/bin/ld.</p>



<a name="221467177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221467177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221467177">(Jan 03 2021 at 19:41)</a>:</h4>
<p>Hmm, so I said<br>
root@michele-VirtualBox:/usr/sparcv9-solaris/solaris/cross/bin# cp /usr/bin/ld /usr/bin/ld.orig<br>
root@michele-VirtualBox:/usr/sparcv9-solaris/solaris/cross/bin# rm /usr/bin/ld<br>
root@michele-VirtualBox:/usr/sparcv9-solaris/solaris/cross/bin# cp ./ld /usr/bin/ld<br>
root@michele-VirtualBox:/usr/sparcv9-solaris/solaris/cross/bin# file ./ld<br>
./ld: ELF 64-bit MSB shared object, SPARC V9, total store ordering, version 1 (Solaris), dynamically linked, interpreter /usr/lib/sparcv9/ld.so.1, not stripped<br>
root@michele-VirtualBox:/usr/sparcv9-solaris/solaris/cross/bin# <br>
../configure --target=sparcv9-sun-solaris<br>
...<br>
DEBUG: configure:4062: /usr/bin/clang -std=gnu99 --target=sparcv9-solaris2 -o conftest  -Qunused-arguments    conftest.c  1&gt;&amp;5<br>
DEBUG: clang: error: unable to execute command: posix_spawn failed: Exec format error<br>
DEBUG: clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>
DEBUG: configure: failed program was:<br>
DEBUG: #line 4055 "configure"<br>
DEBUG: #include "confdefs.h"<br>
DEBUG: <br>
DEBUG: int main() {<br>
DEBUG: <br>
DEBUG: ; return 0; }<br>
DEBUG: configure: error: compiler is incompatible with sanitize options<br>
ERROR: old-configure failed</p>
<p>So at least now it's not complaining about -C.  But what the heck is "posix_spawn"?  There's not much that's very informative about this on the web (that I can find).</p>



<a name="221467443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221467443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221467443">(Jan 03 2021 at 19:47)</a>:</h4>
<p>Oh wait - I see it's also using /usr/bin/clang.  Is ../configure supposed to be using the SPARC clang?  Honestly, this cross compile stuff is making my eyes cross.</p>



<a name="221469733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221469733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221469733">(Jan 03 2021 at 20:35)</a>:</h4>
<p><code>posix_spawn</code> is used to spawn a new process. It can be faster than <code>fork</code>+<code>exec</code>.</p>



<a name="221571317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221571317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221571317">(Jan 04 2021 at 19:47)</a>:</h4>
<p>it's essentially <code>vfork</code>+<code>exec</code>, which avoids duplicating the page tables for the interim fork</p>



<a name="221572017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221572017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221572017">(Jan 04 2021 at 19:52)</a>:</h4>
<blockquote>
<p>vfork</p>
</blockquote>
<p><a href="https://youtu.be/FIaOmkqrVi0?t=132">https://youtu.be/FIaOmkqrVi0?t=132</a></p>
<div class="youtube-video message_inline_image"><a data-id="FIaOmkqrVi0" href="https://youtu.be/FIaOmkqrVi0?t=132"><img src="https://i.ytimg.com/vi/FIaOmkqrVi0/default.jpg"></a></div>



<a name="221587254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/221587254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#221587254">(Jan 04 2021 at 22:03)</a>:</h4>
<p>I see.  Right now I'm trying to nail down this ld issue.  I simplified the problem as much as I could and still get:</p>
<p>michele@michele-VirtualBox:~$ clang helloworld.c --target=sparcv9-sun-solaris -I/usr/sparcv9-solaris/solaris/cross/sysroot/usr/include/sys --sysroot=/usr/sparcv9-solaris/solaris/cross/sysroot<br>
/usr/bin/ld: unrecognized option '-C'<br>
/usr/bin/ld: use the --help option for usage information<br>
clang: error: linker command failed with exit code 1 (use -v to see invocation)</p>
<p>I guess this is drifting a bit away from Rust now but thanks to all for your help so far.</p>



<a name="222366600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/222366600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#222366600">(Jan 11 2021 at 22:23)</a>:</h4>
<p>Well it looks like I have officially stumped the Mozilla devs.  In doing my cross-compile I'm getting this error:<br>
michele@michele-VirtualBox:/usr/sparcv9-solaris/solaris/cross/bin$ /home/michele/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc - --crate-name ___ --print=file-names -C --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg<br>
error: unknown codegen option: <code>--crate-type</code></p>
<p>This happened during Mozilla's mach build but I can reproduce it by itself from the command line in a different directory.  Any idea what this means?</p>



<a name="222366797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/222366797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cjgillot <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#222366797">(Jan 11 2021 at 22:25)</a>:</h4>
<p>What happens if you remove the <code>-C</code> between <code>--print=file-names</code> and <code>--crate-type bin</code>?</p>



<a name="222379509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/222379509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#222379509">(Jan 12 2021 at 00:53)</a>:</h4>
<p>Very odd.  When I type<br>
michele@michele-VirtualBox:/usr/sparcv9-solaris/solaris/cross/bin$ /home/michele/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg</p>
<p>nothing at all happens.  It's been sitting there for five minutes and hasn't generated any output at all.  What should happen?</p>



<a name="222379561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/222379561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#222379561">(Jan 12 2021 at 00:53)</a>:</h4>
<p>It looks like you have a single - at the start, so it might be reading from stdin?</p>



<a name="222379617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/222379617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#222379617">(Jan 12 2021 at 00:54)</a>:</h4>
<p>That shouldn't be necessary</p>



<a name="222379673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/222379673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#222379673">(Jan 12 2021 at 00:55)</a>:</h4>
<p>I don't know.  That single dash after "rustc" is the way it appears in the mach build command that throws the error.  Should I complain to Mozilla about that?</p>



<a name="222379990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/222379990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#222379990">(Jan 12 2021 at 00:59)</a>:</h4>
<p>hm, not sure - maybe try giving it an empty file instead?</p>



<a name="222380130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/222380130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#222380130">(Jan 12 2021 at 01:01)</a>:</h4>
<p>Am I giving it a file name?  All I see is a bunch of dash dash options.</p>



<a name="222380152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/222380152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#222380152">(Jan 12 2021 at 01:01)</a>:</h4>
<blockquote>
<p>rustc - --crate-name ___ </p>
</blockquote>
<p>this means to compile stdin</p>



<a name="222380304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/222380304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#222380304">(Jan 12 2021 at 01:03)</a>:</h4>
<p>Oh.  I didn't know that.  Well then that seems to point the finger at a spurious -C option since it's not giving an error when I remove it.  I'm going back over to the Mozilla chat to see what they think about it.  If anyone's interested, it's <a href="https://chat.mozilla.org/#/room/#build:mozilla.org">https://chat.mozilla.org/#/room/#build:mozilla.org</a></p>



<a name="222393337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/222393337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#222393337">(Jan 12 2021 at 05:30)</a>:</h4>
<p>Cargo runs that rustc command at the start of a compilation to detect the target configuration. It probably just gives an empty source file on stdin, which you can simulate using ctrl-d to send eof on stdin.</p>



<a name="222490354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Building%20Rust%20cross%20compiler/near/222490354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Michele <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Building.20Rust.20cross.20compiler.html#222490354">(Jan 12 2021 at 20:34)</a>:</h4>
<p>Thanks!  CTRL-D did the trick and the command ran successfully.  Why do you suppose they've got that -C in there and why does that throw an error?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>